import { configureStore } from '@reduxjs/toolkit';
import PersonalInformationReducer from './PersonalInformation';
import SupplierInformationReducer from './SupplierManagement';
import CustomerInformationReducer from './CustomerManagement';
import CommodityInformationReducer from './CommodityManagement';
import WarehouseManagementReducer from './WarehouseManagement';
import AuthReducer from './Auth';
import UserManagementReducer from './UserManagement';
import InventoryManagement from './InventoryManagement';
import IssueInvoice from './IssueInvoice';
import SalesManagement from './SalesManagement';
import InvoiceOperations from './InvoiceOperations';

const store = configureStore({
  reducer: {
    personalInformation: PersonalInformationReducer,
    supplierInformationReducer: SupplierInformationReducer,
    customerInformationReducer: CustomerInformationReducer,
    commodityInformationReducer: CommodityInformationReducer,
    auth: AuthReducer,
    userManagementReducer: UserManagementReducer,
    warehouseManagementReducer: WarehouseManagementReducer,
    inventoryManagementReducer: InventoryManagement,
    issueInvoiceReducer: IssueInvoice,
    salesManagementReducer: SalesManagement,
    invoiceReducer: InvoiceOperations
  }
});


export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
export { store };
